/* GUI CONVERTED from rcshwbc5.p (converter v1.75) Sat Aug 12 23:02:33 2000 */
/* rcshwbc5.p - LOOKUP WORK ORDER MASTER FROM INVENTORY DB                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*V8:ConvertMode=Maintenance                                                 */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                      */
/* REVISION: 8.6           CREATED : 10/29/97   BY: *K15N* Jim Williams      */
/* REVISION: 8.6     LAST MODIFIED : 05/20/98   BY: *K1Q4* Alfred Tan        */
/* REVISION: 8.6     LAST MODIFIED : 10/05/99   BY: *K21N* Santosh Rao       */
/* REVISION: 9.1     LAST MODIFIED : 08/12/00   BY: *N0KP* myb               */
/* MOVED CODE FROM rcshwbc2.p IN ORDER TO FIND WORK ORDERS IN REMOTE DB      */


         define input parameter sodfanbr like sod_fa_nbr.
         define input parameter sodpart like sod_part.
         define output parameter part_fa_lot like wo_lot.

         /* FOR an ATO WITH F/A WO THEN USE THE FIRST ID         */
         /* ALLOW CHANGES ONLY IF THERE ARE MORE THAN 1 WO ID    */

/*K21N*/ for first fac_ctrl
/*K21N*/    fields(fac_wo_rec) no-lock:
/*K21N*/ end. /* FOR FIRST FAC_CTRL */

         find wo_mstr no-lock where wo_nbr = sodfanbr
              and wo_type = "F"
              and wo_part = sodpart no-error.

/*K21N*/ /* THE WORK ORDER ID WILL NOT BE ASSIGNED IN PRE-SHIPPER/SHIPPER  */
/*K21N*/ /* WORKBENCH WHEN RECEIVE F/A IN WO = YES TO MAKE IT CONSISTENT   */
/*K21N*/ /* WITH PICKLIST/PRE-SHIPPER - AUTOMATIC                          */

/*K21N** if available wo_mstr then part_fa_lot = wo_lot.   */
/*K21N*/ if available wo_mstr and
/*K21N*/    fac_wo_rec = no then
/*K21N*/    part_fa_lot = wo_lot.
         if ambiguous wo_mstr then do:
            find first wo_mstr no-lock where wo_nbr = sodfanbr
                 and wo_type = "F" and wo_part = sodpart no-error.
/*K21N**    if available wo_mstr  then part_fa_lot = wo_lot. */
/*K21N*/    if available wo_mstr and
/*K21N*/       fac_wo_rec = no then
/*K21N*/       part_fa_lot = wo_lot.
         end.
